package com.ofr.ejb.service;

import com.ofr.ejb.dao.UserDao;
import com.ofr.ejb.entities.User;

import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 * Created with IntelliJ IDEA.
 * User: imon
 * Date: 3/31/13
 * Time: 10:33 AM
 * To change this template use File | Settings | File Templates.
 */
@Stateless
public class UserServiceImpl implements UserService {

    @EJB
    UserDao userDao;

    @Override
    public User logInService(String email, String password) {
        return userDao.verifyUser(email, password);
    }

    @Override
    public void signUpService(User user) {
        user.setRole("user");
        userDao.saveUser(user);
    }
}
